package com.practice.springboot.dubbo.provider.service.impl;

import com.practice.spring.boot.dubbo.api.IDemoUserService;
import com.practice.spring.boot.dubbo.entity.MybatisDemoUser;
import com.practice.springboot.dubbo.provider.mapper.MybatisDemoUserMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import java.util.List;

/**
 *
 * @author yangdejun
 */
@DubboService(group = "dev",
        version = "1.0.0",
        cluster = "failover",
        retries = 3,
        loadbalance = "leastactive")
public class IDemoUserServiceImpl implements IDemoUserService {

    private static final Logger log = LoggerFactory.getLogger(IDemoUserServiceImpl.class);

    @Resource
    private MybatisDemoUserMapper demoUserMapper;

    @Override
    public List<MybatisDemoUser> findAll() {
        log.info("invoke me ~~~");
        return demoUserMapper.findAll();
    }
}
